package Model;

import java.util.ArrayList;

/**
 * The object of venue timeslot is assigned to every event instance and represents a set of seats in space (Venue) and time (time of the event).
 * This class is used to treats 3D physical seats in a 4D world.
 * 
 * @author Yury Kitaev
 *
 */
public class VenueTimeslot 
{
	private Venue venue;
	private ArrayList<Seat> seats;
	
	/**
	 * Construtor 
	 * @param name The name of the venue
	 * @param address The address
	 * @param capacity Maximum number of seats available for reservation
	 */
	public VenueTimeslot(Venue venue) 
	{
		super();
		
		this.venue = venue;

		// Venue creates its own seats - GRASP principle "Creator"
		this.seats = new ArrayList<Seat>();
		for (int i = 0; i < venue.getCapacity(); ++i)
		{
			Seat seat = new Seat(false, i+1, this);
			seats.add(seat);
		}
	}

	public Venue getVenue() 
	{
		return venue;
	}

	public void setVenue(Venue venue) 
	{
		this.venue = venue;
	}

	public ArrayList<Seat> getSeats() 
	{
		return seats;
	}

	public void setSeats(ArrayList<Seat> seats) 
	{
		this.seats = seats;
	}	
}
